﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SIG.Model.Case;

namespace SIG.Data.Mapping
{
    public class ClientMap : EntityTypeConfiguration<Client>
    {
        public ClientMap()
        {
            this.HasKey(c => c.Id);
            this.Property(b => b.Id)
              .HasColumnName("Id")
              .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.ToTable("ClientSet");
            

            this.Property(p => p.ClientName).HasMaxLength(50).IsRequired();
            this.Property(p => p.Homepage).HasMaxLength(150).IsOptional();
            this.Property(p => p.LogoURL).HasMaxLength(150).IsRequired();
            this.Property(p => p.Importance).IsRequired();
            this.Property(p => p.Active).IsRequired();
            this.Property(p => p.CreatedDate).IsRequired().HasColumnType("datetime");
            this.Property(p => p.CreatedBy).HasMaxLength(50);
            this.Property(p => p.UpdatedDate).IsOptional().HasColumnType("datetime");
            this.Property(p => p.UpdatedBy).IsOptional().HasMaxLength(50);

          
        }
    }
}
